{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "8e72d84f-4083-4d32-a20e-cc1fee131e53",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3*4的原数组:\n",
      " [[18 11 66 40]\n",
      " [47 50 48 73]\n",
      " [74 58  3 86]]\n",
      "转置后4*3的数组:\n",
      " [[18 47 74]\n",
      " [11 50 58]\n",
      " [66 48  3]\n",
      " [40 73 86]]\n",
      "变形后2*6的数组:\n",
      " [[18 11 66 40 47 50]\n",
      " [48 73 74 58  3 86]]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "arr = np.random.randint(1,100, size=(3,4))\n",
    "print('3*4的原数组:\\n',arr)\n",
    "print('转置后4*3的数组:\\n',arr.T)\n",
    "print('变形后2*6的数组:\\n',arr.reshape(2,6))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e605a85f-11c1-42a8-9a6d-5f367144f414",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
